#pragma once

#include "inc.h"

#include <QtGui/QtEvents>

namespace Core {

class IEngine
{
public:
    /**
      Perform context initialization, called on Core::Window engine setting.
      @param screen The main screen surface.
      */
    virtual void initialization() = 0;

    /** All the games calculation and updating.
        @param elapsedTimeMs The time in milliseconds elapsed since the
        function was called last.
        **/
    virtual void logic(const long& elapsedTimeMs) = 0;

    /**
      Renders engine scene
      */
    virtual void draw() = 0;

    /**
     * @brief onKeyDown handles key pressing
     * @param key pressed key code
     * Even if user holds the key pressed, ONLY ONE event will occur.
     */
    virtual void onKeyDown(QKeyEvent *event) = 0;

    /**
     * @brief onKeyUp handles key up event
     * @param key previously pressed key code
     */
    virtual void onKeyUp(QKeyEvent *event) = 0;

    /**
     * @brief onMouseUp handles mouse button up
     */
    virtual void onMouseUp(QMouseEvent *event) = 0;

    /**
     * @brief onMouseDown handles mouse button down
     */
    virtual void onMouseDown(QMouseEvent *event) = 0;

    /**
     * @brief onMouseMove handles mouse cursor moving
     */
    virtual void onMouseMove(QMouseEvent *event) = 0;

    /**
     * @brief onMouseMove handles mouse wheel moving (rotating)
     */
    virtual void onWheelMove(QWheelEvent *event) = 0;


    virtual ~IEngine() {}
};

} // namespace Core
